# -*- coding: utf-8 -*
from .enums import DeviceName


def generate_data_key(which: DeviceName):
    """生成各指标的初始化数据"""
    data = {
        "CPU": {
            "%usr": 0.0,
            "%sys": 0.0,
            "%iowait": 0.0,
            "%irq": 0.0,
            "%soft": 0.0,
            "%nice": 0.0,
            "%idle": 0.0,
            "load-1": 0.0,
            "load-5": 0.0,
            "load-15": 0.0,
            "cs": 0.0
        },
        "DISK": {
            "r/s": 0.0,
            "rkB/s": 0.0,
            "rrqm/s": 0.0,
            "%rrqm": 0.0,
            "r_await": 0.0,
            "rareq-sz": 0.0,
            "w/s": 0.0,
            "wkB/s": 0.0,
            "wrqm/s": 0.0,
            "%wrqm": 0.0,
            "w_await": 0.0,
            "wareq-sz": 0.0,
            "d/s": 0.0,
            "dkB/s": 0.0,
            "drqm/s": 0.0,
            "%drqm": 0.0,
            "d_await": 0.0,
            "dareq-sz": 0.0,
            "aqu-sz": 0.0,
            "%util": 0.0,
        },
        "MEM": {
            "%free_memory": 0.0,
            "%free_swap": 0.0,
            "%cache_buff": 0.0,
        },
        "NET": {
            "rxkB/s": 0.0,
            "txkB/s": 0.0,
            "rxpck/s": 0.0,
            "txpck/s": 0.0,
            "%ifutil": 0.0,
        }
    }
    data["SUMMARY"] = {**data["CPU"], **data["DISK"], **data["MEM"], **data["NET"]}
    return data[which.name]
